package com.etoak.controller;

import com.etoak.bean.ResultVo;
import com.etoak.utils.BaiDuApiUtil;
import org.springframework.web.bind.annotation.CrossOrigin;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RestController;

import javax.annotation.Resource;
import java.io.IOException;

@RestController
@CrossOrigin
public class CommonController {

    @Resource
    BaiDuApiUtil baiDuApiUtils;

    @GetMapping("/examine")
    public ResultVo examine(String text){
        ResultVo resultVo = null;
        try {
          resultVo =  baiDuApiUtils.examine(text);
        } catch (IOException e) {
            throw new RuntimeException(e);
        }
        return resultVo;
    }


}
